package cn.edu.scau.cmi.mingjunhui.singleton;

import java.util.HashSet;
import java.util.Set;

public class Marshal {
	private String name;
	private static Set<Marshal> marshalSet = new HashSet<Marshal>();
	
	private Marshal(String _name) {
		this.name = _name;
	}
	
	public static Set<Marshal> addInstance(String _name){
		if(marshalSet.size() < 10) {
			Marshal marshal = new Marshal(_name);
			marshalSet.add(marshal);
		}
		return marshalSet;
	}
		
	
	public String getName() {
		return this.name;
	}
	
}


